package tpo.wmb.provider.service;


import dto.Dto;
import dto.ShowWares;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pojo.BuyOrder;
import pojo.BuyReturn;
import pojo.DetailList;
import pojo.User;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface OrderService {
    /**
     *订单分页条件查询
     */
    List<BuyOrder> selectOrderList(Map<String,Object> map);

    /**
     * 查看订单详情
     */
    BuyOrder selectOrder(Integer id);

    /**
     * 修改订单和明细
     */
    Integer updateOrder( BuyOrder buyOrder);

    /**
     * 仅仅修改订单2
     */
    Integer updateOrder2( BuyOrder buyOrder);

    /**
     * 订单已收款,减去作废的已收款
     * @param code
     * @param integer
     * @return
     */
    Integer updateOrder3( String code, BigDecimal integer);

    /**
     * 新增订单
     */
    Integer insertOrder( BuyOrder buyOrder);

    /**
     * code查看订单详情
     * @param code
     * @return
     */
    BuyOrder selectOrdeCoder(String code);

    /**
     * (逻辑)删除订单
     */
    Integer deleteOrder( Integer id);

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++分割线---------------------------------------


    /**
     * 分页条件查询退货单
     */
    List<BuyReturn> selectBuyReturnList(Map<String,Object> map);


    /**
     * 查看退货单详情
     */
    BuyReturn selectBuyReturn(Integer id);


    /**
     * 修改退货单
     */
    Integer updateBuyReturn( BuyReturn buyReturn);


    /**
     * 新增退货单
     */
    Integer insertBuyReturn( BuyReturn buyReturn);


    /**
     * 逻辑删除退货单
     */
    Integer deleteBuyReturn( Integer id);


    // ++++++++++++++++++++++++++++++++++++++++++++++++++++++分割线---------------------------------------


    /**
     * 根据订单号联合查询商品到 ShowWares 清单对象
     */
    List<ShowWares> selectDetailList(String orderId, Integer type);

    /**
     * 根据退货单号联合查询商品到 ShowWares 清单对象
     * @param orderId
     * @param type
     * @return
     */
    List<ShowWares> selectDetailList2( String orderId, Integer type );


    /**
     * 新增明细表
     * @param detailList
     * @return
     */
    Integer insertDetailList( DetailList detailList);


    /**
     *修改明细表
     * @param detailList
     * @return
     */
    Integer updateDetailList( DetailList detailList);


    /**
     * 删除明细表
     * @param id
     * @return
     */
    Integer deleteDetailList( Integer id);

    /**
     * 根据退货单id显示退货单页面
     * @param id
     * @return
     */
    Map<String,Object> seeUpdateBuyReturn(Integer id);


    /**
     * 订单明细和商品联合查询
     * @param orderId
     * @return
     */
    Map<String,Object> detailListWares(String orderId);


    /**
     * 根据订单号查出客户
     * @param orderId
     * @return
     */
    User orderUser(Integer orderId);

    /**
     * 修改订单状态
     * @param
     * @return
     */
    Integer updateOrderState(Integer orderStaId,Integer recStaId,Integer id);

    /**
     * (真)删除订单
     * @param code
     * @return
     */
    Integer deleteOrder2(String code);

    /**
     * 查询用户所有订单
     * @param userId
     * @return
     */
    List<BuyOrder> selectOrderList2(Integer userId);

    /**
     * 修改退货单状态
     * @param orderSta 退货单状态
     * @param receSta 付款状态
     * @param id id
     * @return
     */
    Integer updateBuyReturnState( Integer orderSta, Integer receSta, Integer id);

    /**
     * 查看退货单详情
     * @param code
     * @return
     */
    BuyReturn selectBuyReturn2(String code);

    /**
     * 修改退货单
     * @param code
     * @param bigDecimal
     * @return
     */
    Integer updateBuyReturn2(String code, BigDecimal bigDecimal);


    /**
     * 批量修改订单明细
     * @return
     */
    Integer updateDetailList2( List<DetailList> list);


}
